<template>
	<view class="shop-block">
		<view class="shop-item" v-for="item in list" :key="item.id"
			@click="navigate('/page_other/activity/merchant?id='+item.id+'&type=2&activityType=2&jumpActivity='+5)">
			<image :src="cloudStorage+item.businessFace" mode="scaleToFill" class="shop-img"></image>
			<view class="shop-info">
				<view class="name-block">
					<view class="shop-name">{{item.businessName}}</view>
					<view class="distance-item">
						<image class="img"
							src="https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/alliance/distance.png">
						</image>
						<view class="address">{{item.distance}}km</view>
					</view>
				</view>
				<view class="label-item">
					<view class="label-info">
						<image
							src="https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/alliance/renqi.png"
							class="img">
						</image>
						<view class="tips">{{item.label||''}}</view>
					</view>
					<view class="address-item">
						<image class="img"
							src="https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/alliance/site.png">
						</image>
						<view class="address">{{item.address}}</view>
					</view>
				</view>
				<view class="address-block">


				</view>
				<view class="meal-item" v-if="item.activityList">
					<view class="meal-list" v-for="item in item.activityList" :key="item.id">
						<image :src="cloudStorage+item.cover" mode="scaleToFill" class="image"></image>
						<view class="name">{{item.activityName}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "ShopList",
		props: {
			list: {
				value: Array,
				default: []
			},
		},
		data() {
			return {};
		}
	}
</script>

<style lang="scss" scoped>
	.shop-block {
		.shop-item {
			display: flex;
			margin-bottom: 30rpx;
			background: #FFFFFF;
			padding: 30rpx;
			border-radius: 20rpx;

			.shop-img {
				width: 100rpx;
				height: 100rpx;
				border-radius: 10rpx;
				margin-right: 20rpx;
			}

			.shop-info {
				width: calc((100% - 120rpx));

				.name-block {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.distance-item {
						width: 140rpx;
						display: flex;
						align-items: center;
						justify-content: flex-end;

						.img {
							width: 30rpx;
							height: 30rpx;
							margin-right: 6rpx;
						}

						.address {
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
							font-size: 26rpx;
							color: #767676;
						}
					}
				}

				.shop-name {
					font-weight: bold;
				}

				.label-item {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 20rpx;

					.label-info {
						display: flex;
						align-items: center;
						background: #FEF3EF;
						padding: 6rpx 18rpx;
						border-radius: 6rpx;

						.img {
							width: 25rpx;
							height: 25rpx;
							margin-right: 10rpx;
						}

						.tips {
							font-size: 24rpx;
							color: #FF6830;
						}
					}

					.address-item {
						display: flex;
						align-items: center;
						width: calc(100% - 200rpx);

						.img {
							width: 28rpx;
							height: 28rpx;
							margin-right: 6rpx;
						}

						.address {
							width: calc(100% - 40rpx);
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
							font-size: 28rpx;
							color: #767676;
						}
					}
				}

				.address-block {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 20rpx;




				}

				.meal-item {
					display: flex;
					align-items: center;
					margin-top: 30rpx;
					overflow-x: scroll;

					.meal-list {
						width: 140rpx;
						margin-right: 20rpx;

						.image {
							width: 140rpx;
							height: 140rpx;
							border-radius: 14rpx;
						}

						.name {
							font-size: 28rpx;
							margin-top: 8rpx;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}

						.price {
							color: #FF0014;
							font-weight: bold;
							margin-top: 8rpx;
							font-size: 24rpx;
						}
					}
				}
			}
		}
	}
</style>